package main

import (
	"crypto/md5"
	"net"
	"os"
	"path"
	"path/filepath"
)

func main() {
	var mac string
	var err error
	dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
	interfaces, err := net.Interfaces()
	if err != nil {
		panic("Poor soul, here is what you got:" + err.Error())
	}
	for _, inter := range interfaces {
		macx := inter.HardwareAddr
		mac = mac + macx.String()
		println(macx.String())
	}
	cc := md5.New()
	cc.Write([]byte(mac))
	dd := cc.Sum(nil)
	f, err := os.Create(path.Join(dir, "lic"))
	f.Write(dd)
	f.Sync()
	f.Close()
}
